package by.admonko.universaltesting.datamodel;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
public class TestResult {
	/*
	 * id serial NOT NULL, user_id integer NOT NULL, user_group_id integer NOT
	 * NULL, test_id integer NOT NULL, test_date date NOT NULL DEFAULT now(),
	 * res_raiting integer NOT NULL, owner_note character varying(2000),
	 */

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	@ManyToOne(fetch = FetchType.LAZY, targetEntity = UserTbl.class)
	private UserTbl user;

	@ManyToOne(fetch = FetchType.LAZY, targetEntity = UserGroup.class)
	private UserGroup userGroup;

	@ManyToOne(fetch = FetchType.LAZY, targetEntity = Test.class)
	private Test test;

	@Column
	private Date testDate;

	@Column
	private Integer testRaiting;

	@Column
	private String OwnerNote;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public UserTbl getUser() {
		return user;
	}

	public void setUser(UserTbl user) {
		this.user = user;
	}

	public UserGroup getUserGroup() {
		return userGroup;
	}

	public void setUserGroup(UserGroup usergroup) {
		this.userGroup = usergroup;
	}

	public Test getTest() {
		return test;
	}

	public void setTest(Test test) {
		this.test = test;
	}

	public Date getTestDate() {
		return testDate;
	}

	public void setTestDate(Date testDate) {
		this.testDate = testDate;
	}

	public Integer getTestRaiting() {
		return testRaiting;
	}

	public void setTestRaiting(Integer testRating) {
		this.testRaiting = testRating;
	}

	public String getOwnerNote() {
		return OwnerNote;
	}

	public void setOwnerNote(String ownerNote) {
		OwnerNote = ownerNote;
	}

}
